package com.blueocean_health.care.management.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.blueocean_health.care.management.domain.base.NurseWorkerInfo;
import com.blueocean_health.care.management.domain.dto.NurseWorkerInfoDto;
import com.blueocean_health.care.management.domain.dto.NurseWorkerInfoHealthCertResponseDto;
import com.blueocean_health.care.management.domain.dto.NurseWorkerInfoRequestDto;
import com.blueocean_health.care.management.domain.dto.NurseWorkerInfoResponseDto;
import com.blueocean_health.care.management.domain.dto.NurseWorkerListDto;
import com.blueocean_health.care.management.domain.dto.PullDownDto;
import com.blueocean_health.care.management.domain.worktablevo.WorkersVo;
import com.blueocean_health.care.management.util.MyMapper;

public interface NurseWorkerInfoMapper extends MyMapper<NurseWorkerInfo> {
	/**
	 * 通过护工id查询护工详情
	 * 
	 * @param workerId
	 * @return
	 */
	NurseWorkerInfoDto selectById(Integer id);

	/**
	 * 查询护工列表
	 * 
	 * @param nurseWorkerInfoDto
	 * @param hospital
	 * @return
	 */
	List<NurseWorkerInfoResponseDto> list(@Param("nurseWorkerInfoDto") NurseWorkerInfoRequestDto nurseWorkerInfoDto,
			@Param("hospital") String hospital);

	/**
	 * 护工列表 2018年6月19日15:13:42
	 * 
	 * @param hospitalId
	 * @return
	 */
	List<PullDownDto> getNurseList(Map<String, String> map);

	/**
	 * 根据护工姓名获取护工列表 2017年10月20日15:15:53
	 * 
	 * @param workerName
	 * @return
	 */
	List<NurseWorkerListDto> getNurseWorkerList(Map<String, String> map);

	/**
	 * 根据护工Id获取护工详情 2017年10月23日11:05:52
	 * 
	 * @param workerId
	 * @return
	 */
	NurseWorkerInfoDto selectByWorkerId(String workerId);

	@Select("SELECT nw.`id` AS workerId,nw.worker_name AS workerName FROM nurse_worker_info nw WHERE nw.`has_disable` = 1 AND nw.`is_del` = 0 ")
	List<WorkersVo> getAllWorkers();

	/**
	 * 批量更新护工拼音字段
	 * 
	 * @param workerNamePinYin
	 * @param id
	 * @return
	 */
	@Update("UPDATE nurse_worker_info SET worker_name_pin_yin=#{workerNamePinYin} WHERE id=#{id}")
	Boolean updateWorkernamePinyin(@Param("workerNamePinYin") String workerNamePinYin, @Param("id") Integer id);

	/**
	 * 删除或恢复护工
	 * 
	 * @param record
	 * @return
	 */
	int updateIsdelById(NurseWorkerInfo record);

	/**
	 * 健康证延期提醒列表
	 * @param nurseWorkerInfoRequestDto
	 * @param hospitalId
	 * @return
	 */
	List<NurseWorkerInfoHealthCertResponseDto> listHealthCert(@Param("nurseWorkerInfoRequestDto")NurseWorkerInfoRequestDto nurseWorkerInfoRequestDto,
			@Param("hospitalId")String hospitalId);

	/**
	 * 提醒补办--查询id对应的护工健康证情况
	 * @param nurseWorkerInfoDto
	 * @param hospitalId
	 * @return
	 */
	NurseWorkerInfoHealthCertResponseDto selectHealthCertByIdAndHospitalId(@Param("nurseWorkerInfoRequestDto")NurseWorkerInfoDto nurseWorkerInfoDto,
			@Param("hospitalId")String hospitalId);

	
	/**
	 * 根据Id集合查找护工集合
	 * @param idsList
	 * @param hospitalId
	 * @return
	 */
	List<NurseWorkerInfoDto> selectNurseListByIdsAndHospitalId(@Param("ids")Integer[] ids, @Param("hospitalId")String hospitalId);
	

}